Run this code to convert the raw jpg images to a numpy ndarray # source https://www.kaggle.com/datasets/kvpratama/pokemon-images-dataset pokemon = [] DATADIR = r"path to folder" # Let's plot one Pokemon and see how it looks. for img in os.listdir(DATADIR): img_array = cv2.imread(os.path.join(DATADIR, img)) print("# name of the image: ", img) # name of the image # converting BGR to RGB as opencv read images in BGR format. img_array = cv2.cvtColor(img_array, cv2.COLOR_BGR2RGB) #plt.imshow(img_array) #plt.show() # print(img) # print(type(img_array)) pokemon.append([img_array]) np.save("pokemon.npy", pokemon)